// 验证规则
$('#address').validate({
    rules: {
        name: {
            required: true,
            rangelength:[2,5]
        },
        tel: {
            required: true,
            telNum: true
        },
        province: {
            required: true
        },
        city: {
            required: true
        },
        county: {
            required: true
        },
        street:{
            required: true,
            minlength:5
        }
    },
    messages: {

    },
    errorPlacement: function (error, element) {
        $(element).siblings('.u-ts').html(error)
    },
    errorElement: 'span',
    submitHandler: function (form) {
        form.submit();
    }
});

jQuery.validator.addMethod('telNum', function (value, element) {
    var phoneNum = /^[1][34578][\d]{9}$/.test(value);
    return this.optional(element) || phoneNum
}, '请输入正确手机号');

